//
//  MListModel.m
//  NeusoftHBSJSober
//
//  Created by Apple-21 on 15/11/3.
//  Copyright (c) 2015年 com.neusoftsober. All rights reserved.
//

#import "MListModel.h"

@implementation MListModel

@end
@implementation MListHttpResult

- (id)getListResultWithDictionaryJSON:(NSDictionary *)dct {
    if (dct) {
        MListModel *model = [[MListModel alloc]init];
        
        model.AID = [((NSNumber *)dct[@"AID"]) stringValue];
        
        model.BName = (dct[@"BName"] == [NSNull null]) ? @"" : dct[@"BName"];
        
        model.companyName = (dct[@"CompanyName"] == [NSNull null]) ? @"" : dct[@"CompanyName"];
        
        model.createUserID = [((NSNumber *)dct[@"CreateUserID"]) stringValue];
        
        model.listDescription = (dct[@"Description"] == [NSNull null]) ? @"" : dct[@"Description"];
        
        model.KID = [((NSNumber *)dct[@"KID"]) stringValue];
        
        model.KName = (dct[@"KName"] == [NSNull null]) ? @"" : dct[@"KName"];
        
        model.phone = (dct[@"Phone"] == [NSNull null]) ? @"" : dct[@"Phone"];
        
        model.price = [((NSNumber *)dct[@"Price"]) stringValue];
        
        model.QQ = dct[@"QQ"];
        
        model.saleManMemo = (dct[@"SalemanMemo"] == [NSNull null]) ? @"" : dct[@"SalemanMemo"];
        
        model.selectPrice = (dct[@"SelectPrice"] == [NSNull null]) ? @"" : dct[@"SelectPrice"];
        
        model.selectPriceID = [((NSNumber *)dct[@"SelectPriceID"]) stringValue];
        
        model.selectSize = (dct[@"SelectSize"] == [NSNull null]) ? @"" : dct[@"SelectSize"];
        
        model.selectSizeID = [((NSNumber *)dct[@"SelectSizeID"]) stringValue];
        
        model.selectType = (dct[@"SelectType"] == [NSNull null]) ? @"" : dct[@"SelectType"];
        
        model.selectTypeID = [((NSNumber *)dct[@"SelectTypeID"]) stringValue];
        
        model.address = (dct[@"address"] == [NSNull null]) ? @"" : dct[@"address"];
        
        model.city = (dct[@"city"] == [NSNull null]) ? @"" : dct[@"city"];
        
        model.coordType = [((NSNumber *)dct[@"coord_type"]) stringValue];
        
        model.distance = (dct[@"distance"] == [NSNull null]) ? @"" : dct[@"distance"];
        
        model.district = (dct[@"district"] == [NSNull null]) ? @"" : dct[@"district"];
        
        model.geotableID = (dct[@"geotable_id"] == [NSNull null]) ? @"" : dct[@"geotable_id"];
        
        model.latitude = [((NSNumber *)dct[@"location"][1]) stringValue];
        
        model.longtitude = [((NSNumber *)dct[@"location"][0]) stringValue];
        
        model.province = (dct[@"province"] == [NSNull null]) ? @"" : dct[@"province"];
        
        model.tags = (dct[@"tags"] == [NSNull null]) ? @"" : dct[@"tags"];
        
        model.title = (dct[@"title"] == [NSNull null]) ? @"" : dct[@"title"];
        
        model.uid = (dct[@"uid"] == [NSNull null]) ? @"" : dct[@"uid"];
        
        model.weight = (dct[@"weight"] == [NSNull null]) ? @"" : dct[@"weight"];
        
        return model;
    }
    return nil;
}
- (id)getListResultWithArrayJSON:(NSArray *)array; {
    if (array) {
        NSMutableArray *data = [NSMutableArray array];
        for (NSDictionary * dct in array) {
            [data addObject:[self getListResultWithDictionaryJSON:dct]];
        }
        return data;
    }
    return nil;
}

- (id)getMerchantProductListResultWithArrayJSON:(NSArray *)array {
    if (array) {
        NSMutableArray *data = [NSMutableArray array];
        for (NSDictionary * dct in array) {
            [data addObject:[self getListResultWithDictionaryJSON:dct]];
        }
        return data;
    }
    return nil;
}

@end